/**
 * 
 */
package com.base.myproject.client.busi.b2c;

import com.base.myproject.client.busi.b2c.b2cgcodeattr.B2cGcodeAttr;

/**
 * 一个产品的包含的信息
 * @author zgw
 *2009-7-16 下午12:59:49
 * javazgw@gmail.com
 */
public class ProdectDesc {
	String name; //产品描述的名称
	String mainimagepath;//主要的图片路径
	String price;//价格，这是最直观的价格
	String discountprice;//折扣后价格
	String qty;//购买数量
	String totle;//总金额
	String	gcode;
	String gname;
	String bcode;
	String bname;
	String treecode;
	String treename;
	//--------------------//
	/**
	 * 加入购物车时用到
	 */
	
	String shopdate;//加入购物车的时间

	
	final static int NEWADD=1;
	final static int DELETE=2;
	final static int UPDATE=4;
	final static int nostatus=0;
	int status=nostatus;
	//-------------------//
	java.util.Map<String, B2cGcodeAttr> gcodeattrmap = new java.util.HashMap<String, B2cGcodeAttr>();
	String id ;//对应数据库的b2cgcode
	public ProdectDesc(String id)
	{
		this.id = id;
		
	}
/**
 * 商品名字
 * @return
 */
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getMainimagepath() {
		return mainimagepath;
	}

	public void setMainimagepath(String mainimagepath) {
		this.mainimagepath = mainimagepath;
	}

	public String getPrice() {
		return price;
	}

	public void setPrice(String price) {
		this.price = price;
	}

	public java.util.Map<String, B2cGcodeAttr> getGcodeattrmap() {
		return gcodeattrmap;
	}

	public void setGcodeattrmap(java.util.Map<String, B2cGcodeAttr> gcodeattrmap) {
		this.gcodeattrmap = gcodeattrmap;
	}

	public void put(String key,B2cGcodeAttr attr)
	{
		attr.setB2cgcodeid(id );
		gcodeattrmap.put(key, attr);
	}
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	/**
	 * 设置描述的状态
	 * @return
	 */
	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}
	public String getDiscountprice() {
		return discountprice;
	}
	public void setDiscountprice(String discountprice) {
		this.discountprice = discountprice;
	}
	public String getQty() {
		return qty;
	}
	public void setQty(String qty) {
		this.qty = qty;
	}
	public String getTotle() {
		return totle;
	}
	public void setTotle(String totle) {
		this.totle = totle;
	}
	public String getGcode() {
		return gcode;
	}
	public void setGcode(String gcode) {
		this.gcode = gcode;
	}
	public String getGname() {
		return gname;
	}
	public void setGname(String gname) {
		this.gname = gname;
	}
	public String getBcode() {
		return bcode;
	}
	public void setBcode(String bcode) {
		this.bcode = bcode;
	}
	public String getBname() {
		return bname;
	}
	public void setBname(String bname) {
		this.bname = bname;
	}
	public String getShopdate() {
		return shopdate;
	}
	public void setShopdate(String shopdate) {
		this.shopdate = shopdate;
	}

	/**
	 * @return the treecode
	 */
	public String getTreecode() {
		return treecode;
	}
	/**
	 * @param treecode the treecode to set
	 */
	public void setTreecode(String treecode) {
		this.treecode = treecode;
	}
	/**
	 * @return the treename
	 */
	public String getTreename() {
		return treename;
	}
	/**
	 * @param treename the treename to set
	 */
	public void setTreename(String treename) {
		this.treename = treename;
	}
	public String toString()
	{
		String str = "";
	
		str +=" name="+name;
		str +=" mainimagepath="+mainimagepath;
		str +=" price="+price;
		str +=" discountprice="+discountprice;
		str +=" qty="+qty;
		str +=" totle="+totle;
		str +=" gcode="+gcode;
		str +=" gname="+gname;
		str +=" attrcount="+gcodeattrmap.size();
		return str;
	}
	
}
